package com.itheima.d6_object_stream;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class Test1ObjectOutputStream {
    public static void main(String[] args) {
        try(
                ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream("C:\\Users\\dell\\IdeaProjects\\file-io-app\\io-app2\\src\\itheima11.txt"))
                ){
            User u=new User("admin","张三",32,"66666666");
            oos.writeObject(u);
            System.out.println("序列化对象成功");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
